package com.ysx.student.zhangqingrong.com.ysx.day2;

import java.util.Scanner;

/**
 * @author 张青荣
 */
public class DemoTest2 {
    Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {

        getYear();
    }

    private static void getYear() {
        while (true) {
            int year = getAnInt();
            // 对year进行处理；
            if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
                System.out.println("是闰年");
            } else {
                System.out.println("是平年");
            }
        }
    }


    /**
     * @return
     */
    private static boolean getAYear() {

        for (; ; ) {
            //  键盘录入，输入然后判断year；
            int year = getAnInt();
            // 对year进行处理；
            if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
                System.out.println("是闰年");
            } else {
                System.out.println("是平年");
            }
        }

    }

    /**
     * @return 获取年份
     */
    private static int getAnInt() {
        //  键盘录入，输入然后判断year；
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入：");
        return sc.nextInt();
    }

}
